﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

namespace h2100
{
    public abstract class hEntityManager
    {
        protected hVisibleGameEntity[] _prototype;
        public hVisibleGameEntity[] Prototypes
        {
            get { return _prototype; }
        }

        protected int _nprototype;
        public int NPrototypes
        {
            get { return _nprototype; }
        }

        protected int[] actionParse(string[] sArgs)
        {
            int[] t = new int[sArgs.Count()];
            for (int i = 0; i < sArgs.Count(); i++)
            {
                t[i] = -1;
                if (!sArgs[i].Equals(""))
                {
                    t[i] = int.Parse(sArgs[i]);
                }
            }
            if (t.Count() == 1 && t[0] == -1)
                return null;
            return t;
        }

        public virtual void initPrototypes(ContentManager contentmanager, hParams args)
        {
            _nprototype = 0;
        }

        public virtual hVisibleGameEntity createObject(int idx)
        {
            return null;
        }
    }
}
